﻿using System;
using Lightray.Hattrick.ChppLib.EntityTypes;

namespace Lightray.Hattrick
{
    public struct YouthPlayerSkill
    {
        private SkillLevel _current, _max;

        public YouthPlayerSkill(SkillLevel current, SkillLevel max)
            : this()
        {
            _current = current;
            _max = max;
        }

        public override string ToString()
        {
            if (_current == _max)
            {
                if (_current == SkillLevel.Unknown)
                    return "?";
                else
                    return ((int)_current).ToString();
            }

            return string.Format("{0}/{1}",
                _current == SkillLevel.Unknown ? "?" : ((int)_current).ToString(),
                _max == SkillLevel.Unknown ? "?" : ((int)_max).ToString());
        }

        public string TextualDescription()
        {
            if (_current == _max)
                return _current.ToString();
            else
                return String.Format("Between {0} to {1}", _current.ToString(), _max.ToString());
        }
    }
}
